// // 引入 封装的api 
import api from './request';

//下面是简写的形式
// getXXX 自定义的接口名字
// export const getXXX = () => api.get('/getXXX ');

// 登录
export const Login = async (params) => await api.post(`/api/login`, params)
// 注册
export const Reguser = async (params) => await api.post(`/api/reguser`, params)

// 获取用户
export const allUser = () => api.get('/api/allUser')
// 筛选用户
export const searchUser = (params) => api.post('/api/searchUser', params)
// 删除用户
export const delUser = (params) => api.post('/api/delUser', params)
// 修改用户信息
export const updateUser = (params) => api.post('/api/updateUser', params)
export const updateCurrentUser = (params) => api.post('/api/update', params)


// 获取商品模块
export const getList = () => api.get('/api/getList')
// 添加商品模块
export const AddList = (params) => api.post('/api/AddList', params)
// 删除商品模块
export const removeList = (params) => api.post('/api/removeList', params)
// 修改商品模块
export const updateList = (params) => api.post('/api/updateList', params)
// 获取所有数据(回收站)
export const getAllList = () => api.get('/api/getalllist')
// 彻底删除商品
export const deleteList = (params) => api.post('/api/deleteList', params)
// 恢复商品
export const recoverList = (params) => api.post('/api/recoverList', params)


// 商品分类标签
// 获取图片
export const getListSort = () => api.get('/tag/getList')
// 删除商品
export const delSort = async (params) => await api.post(`/tag/remove`, params)

// 修改商品名称
export const updateSort = async (params) => await api.post(`/tag/update`, params)
// 添加
export const addSort = async (params) => await api.post(`/tag/add`, params)

// 支付
export const getPayList = async () => await api.get(`/pay/getPayList`)

// 删除
export const removePay = async (params) => await api.post(`/pay/removeList`,params)
export const update = async (params) => await api.post(`/pay/update`,params)


// 优惠卷
export const getPreferential = ()=>api.get('/preferential/getPreferential')
// 删除商品
export const addPreferential =async (params) =>await api.post(`/preferential/addPreferential`, params)
// 修改商品名称
export const delPreferential =async (params) =>await api.post(`/preferential/delPreferential`, params)
// 添加
export const updatePreferential =async (params) =>await api.post(`/preferential/updatePreferential`, params)


// 用户
export const getLoginList = (params)=>api.post('/api/getList',params)
export const getLoginUser = ()=>api.get('/api/getLoginUser')





